package com.hbnu.array;

import java.util.Scanner;

public class ArrayDemo01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 输入数组长度
        System.out.print("请输入数组长度: ");
        int n = scanner.nextInt();

        // 创建数组
        int[] array = new int[n];

        // 输入数组元素
        System.out.println("请输入数组元素:");
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }

        // 打印数组
        System.out.print("数组内容为: ");
        for (int i = 0; i < n; i++) {
            System.out.print(array[i] + " ");
        }
    }
}
